Component({
  properties: {
    visible: {
      type: Boolean,
      value: false
    }
  },
  methods: {
    /**
     * 点击按钮触发事件
     */
    buttonClicked(e) {
      const { index } = e.currentTarget.dataset
      const value = this.data.buttons[index]

      this.triggerEvent('click', { index, value })
    },
  },
})